/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('layout', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddFileMaterialRequest {
  businessId?: string(name='BusinessId'),
  fileName?: string(name='FileName'),
  fileSize?: string(name='FileSize'),
  fileUrl?: string(name='FileUrl'),
  thumbUrl?: string(name='ThumbUrl'),
  title?: string(name='Title'),
  treeNodeId?: string(name='TreeNodeId'),
  type?: string(name='Type'),
}

model AddFileMaterialResponseBody = {
  code?: long(name='Code'),
  data?: string(name='Data'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddFileMaterialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddFileMaterialResponseBody(name='body'),
}

async function addFileMaterialWithOptions(request: AddFileMaterialRequest, runtime: Util.RuntimeOptions): AddFileMaterialResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileSize)) {
    body['FileSize'] = request.fileSize;
  }
  if (!Util.isUnset(request.fileUrl)) {
    body['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.thumbUrl)) {
    body['ThumbUrl'] = request.thumbUrl;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  if (!Util.isUnset(request.treeNodeId)) {
    body['TreeNodeId'] = request.treeNodeId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddFileMaterial',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFileMaterial(request: AddFileMaterialRequest): AddFileMaterialResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFileMaterialWithOptions(request, runtime);
}

model AddTreeNodeRequest {
  businessId?: string(name='BusinessId'),
  parentId?: string(name='ParentId'),
  title?: string(name='Title'),
  type?: string(name='Type'),
}

model AddTreeNodeResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddTreeNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddTreeNodeResponseBody(name='body'),
}

async function addTreeNodeWithOptions(request: AddTreeNodeRequest, runtime: Util.RuntimeOptions): AddTreeNodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.parentId)) {
    body['ParentId'] = request.parentId;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddTreeNode',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addTreeNode(request: AddTreeNodeRequest): AddTreeNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return addTreeNodeWithOptions(request, runtime);
}

model CheckBusinessRequest {
  businessId?: string(name='BusinessId'),
}

model CheckBusinessResponseBody = {
  code?: string(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckBusinessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckBusinessResponseBody(name='body'),
}

async function checkBusinessWithOptions(request: CheckBusinessRequest, runtime: Util.RuntimeOptions): CheckBusinessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessId)) {
    query['BusinessId'] = request.businessId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckBusiness',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkBusiness(request: CheckBusinessRequest): CheckBusinessResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkBusinessWithOptions(request, runtime);
}

model DeleteFileMaterialRequest {
  businessId?: string(name='BusinessId'),
  materialIds?: [ long ](name='MaterialIds'),
  treeNodeId?: string(name='TreeNodeId'),
}

model DeleteFileMaterialShrinkRequest {
  businessId?: string(name='BusinessId'),
  materialIdsShrink?: string(name='MaterialIds'),
  treeNodeId?: string(name='TreeNodeId'),
}

model DeleteFileMaterialResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteFileMaterialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteFileMaterialResponseBody(name='body'),
}

async function deleteFileMaterialWithOptions(tmpReq: DeleteFileMaterialRequest, runtime: Util.RuntimeOptions): DeleteFileMaterialResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteFileMaterialShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.materialIds)) {
    request.materialIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.materialIds, 'MaterialIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.materialIdsShrink)) {
    body['MaterialIds'] = request.materialIdsShrink;
  }
  if (!Util.isUnset(request.treeNodeId)) {
    body['TreeNodeId'] = request.treeNodeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFileMaterial',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFileMaterial(request: DeleteFileMaterialRequest): DeleteFileMaterialResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFileMaterialWithOptions(request, runtime);
}

model DeleteTreeNodeRequest {
  businessId?: string(name='BusinessId'),
  treeNodeId?: string(name='TreeNodeId'),
}

model DeleteTreeNodeResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteTreeNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteTreeNodeResponseBody(name='body'),
}

async function deleteTreeNodeWithOptions(request: DeleteTreeNodeRequest, runtime: Util.RuntimeOptions): DeleteTreeNodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.treeNodeId)) {
    body['TreeNodeId'] = request.treeNodeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTreeNode',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteTreeNode(request: DeleteTreeNodeRequest): DeleteTreeNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTreeNodeWithOptions(request, runtime);
}

model DescribeFileMaterialByPageRequest {
  businessId?: string(name='BusinessId'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  title?: string(name='Title'),
  treeNodeId?: string(name='TreeNodeId'),
  type?: string(name='Type'),
}

model DescribeFileMaterialByPageResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  materialInfos?: [ 
    {
      description?: string(name='Description'),
      displayOrder?: long(name='DisplayOrder'),
      filePath?: string(name='FilePath'),
      fileSize?: long(name='FileSize'),
      gmtCreateTime?: long(name='GmtCreateTime'),
      gmtModifiedTime?: long(name='GmtModifiedTime'),
      id?: long(name='Id'),
      parentId?: long(name='ParentId'),
      thumbnail?: string(name='Thumbnail'),
      title?: string(name='Title'),
      type?: string(name='Type'),
    }
  ](name='MaterialInfos'),
  message?: string(name='Message'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model DescribeFileMaterialByPageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeFileMaterialByPageResponseBody(name='body'),
}

async function describeFileMaterialByPageWithOptions(request: DescribeFileMaterialByPageRequest, runtime: Util.RuntimeOptions): DescribeFileMaterialByPageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  if (!Util.isUnset(request.treeNodeId)) {
    body['TreeNodeId'] = request.treeNodeId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFileMaterialByPage',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFileMaterialByPage(request: DescribeFileMaterialByPageRequest): DescribeFileMaterialByPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFileMaterialByPageWithOptions(request, runtime);
}

model GetConfigJsonRequest {
  businessId?: string(name='BusinessId'),
  fileName?: string(name='FileName'),
}

model GetConfigJsonResponseBody = {
  code?: string(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  json?: string(name='Json'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetConfigJsonResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetConfigJsonResponseBody(name='body'),
}

async function getConfigJsonWithOptions(request: GetConfigJsonRequest, runtime: Util.RuntimeOptions): GetConfigJsonResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessId)) {
    query['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigJson',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getConfigJson(request: GetConfigJsonRequest): GetConfigJsonResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigJsonWithOptions(request, runtime);
}

model GetStorageSignatureRequest {
  businessId?: string(name='BusinessId'),
  fileName?: string(name='FileName'),
  fileSize?: string(name='FileSize'),
  type?: string(name='Type'),
}

model GetStorageSignatureResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  fileUrl?: string(name='FileUrl'),
  message?: string(name='Message'),
  ossSignature?: {
    accessKeyId?: string(name='AccessKeyId'),
    expireTime?: string(name='ExpireTime'),
    filePath?: string(name='FilePath'),
    host?: string(name='Host'),
    policy?: string(name='Policy'),
    signature?: string(name='Signature'),
  }(name='OssSignature'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  thumbUrl?: string(name='ThumbUrl'),
}

model GetStorageSignatureResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStorageSignatureResponseBody(name='body'),
}

async function getStorageSignatureWithOptions(request: GetStorageSignatureRequest, runtime: Util.RuntimeOptions): GetStorageSignatureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileSize)) {
    body['FileSize'] = request.fileSize;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetStorageSignature',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStorageSignature(request: GetStorageSignatureRequest): GetStorageSignatureResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStorageSignatureWithOptions(request, runtime);
}

model MoveFileMaterialRequest {
  businessId?: string(name='BusinessId'),
  materialIds?: [ long ](name='MaterialIds'),
  targetTreeNodeId?: string(name='TargetTreeNodeId'),
}

model MoveFileMaterialShrinkRequest {
  businessId?: string(name='BusinessId'),
  materialIdsShrink?: string(name='MaterialIds'),
  targetTreeNodeId?: string(name='TargetTreeNodeId'),
}

model MoveFileMaterialResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MoveFileMaterialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MoveFileMaterialResponseBody(name='body'),
}

async function moveFileMaterialWithOptions(tmpReq: MoveFileMaterialRequest, runtime: Util.RuntimeOptions): MoveFileMaterialResponse {
  Util.validateModel(tmpReq);
  var request = new MoveFileMaterialShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.materialIds)) {
    request.materialIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.materialIds, 'MaterialIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.materialIdsShrink)) {
    body['MaterialIds'] = request.materialIdsShrink;
  }
  if (!Util.isUnset(request.targetTreeNodeId)) {
    body['TargetTreeNodeId'] = request.targetTreeNodeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MoveFileMaterial',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveFileMaterial(request: MoveFileMaterialRequest): MoveFileMaterialResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveFileMaterialWithOptions(request, runtime);
}

model MoveTreeNodeRequest {
  businessId?: string(name='BusinessId'),
  currentTreeNodeId?: string(name='CurrentTreeNodeId'),
  targetParentId?: string(name='TargetParentId'),
  targetTreeNodeIndex?: string(name='TargetTreeNodeIndex'),
  type?: string(name='Type'),
}

model MoveTreeNodeResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MoveTreeNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MoveTreeNodeResponseBody(name='body'),
}

async function moveTreeNodeWithOptions(request: MoveTreeNodeRequest, runtime: Util.RuntimeOptions): MoveTreeNodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.currentTreeNodeId)) {
    body['CurrentTreeNodeId'] = request.currentTreeNodeId;
  }
  if (!Util.isUnset(request.targetParentId)) {
    body['TargetParentId'] = request.targetParentId;
  }
  if (!Util.isUnset(request.targetTreeNodeIndex)) {
    body['TargetTreeNodeIndex'] = request.targetTreeNodeIndex;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MoveTreeNode',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveTreeNode(request: MoveTreeNodeRequest): MoveTreeNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveTreeNodeWithOptions(request, runtime);
}

model QueryTreeNodesRequest {
  businessId?: string(name='BusinessId'),
  searchText?: string(name='SearchText'),
  type?: string(name='Type'),
}

model QueryTreeNodesResponseBody = {
  code?: string(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  groupList?: map[string]any(name='GroupList'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryTreeNodesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryTreeNodesResponseBody(name='body'),
}

async function queryTreeNodesWithOptions(request: QueryTreeNodesRequest, runtime: Util.RuntimeOptions): QueryTreeNodesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.searchText)) {
    body['SearchText'] = request.searchText;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTreeNodes',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTreeNodes(request: QueryTreeNodesRequest): QueryTreeNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTreeNodesWithOptions(request, runtime);
}

model SaveConfigJsonRequest {
  businessId?: string(name='BusinessId'),
  fileName?: string(name='FileName'),
  json?: string(name='Json'),
}

model SaveConfigJsonResponseBody = {
  code?: string(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SaveConfigJsonResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SaveConfigJsonResponseBody(name='body'),
}

async function saveConfigJsonWithOptions(request: SaveConfigJsonRequest, runtime: Util.RuntimeOptions): SaveConfigJsonResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessId)) {
    query['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.json)) {
    query['Json'] = request.json;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SaveConfigJson',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveConfigJson(request: SaveConfigJsonRequest): SaveConfigJsonResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveConfigJsonWithOptions(request, runtime);
}

model UpdateFileMaterialRequest {
  businessId?: string(name='BusinessId'),
  materialId?: string(name='MaterialId'),
  title?: string(name='Title'),
}

model UpdateFileMaterialResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateFileMaterialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateFileMaterialResponseBody(name='body'),
}

async function updateFileMaterialWithOptions(request: UpdateFileMaterialRequest, runtime: Util.RuntimeOptions): UpdateFileMaterialResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.materialId)) {
    body['MaterialId'] = request.materialId;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFileMaterial',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFileMaterial(request: UpdateFileMaterialRequest): UpdateFileMaterialResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFileMaterialWithOptions(request, runtime);
}

model UpdateTreeNodeRequest {
  businessId?: string(name='BusinessId'),
  title?: string(name='Title'),
  treeNodeId?: string(name='TreeNodeId'),
}

model UpdateTreeNodeResponseBody = {
  code?: long(name='Code'),
  dynamicMessage?: string(name='DynamicMessage'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateTreeNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateTreeNodeResponseBody(name='body'),
}

async function updateTreeNodeWithOptions(request: UpdateTreeNodeRequest, runtime: Util.RuntimeOptions): UpdateTreeNodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessId)) {
    body['BusinessId'] = request.businessId;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  if (!Util.isUnset(request.treeNodeId)) {
    body['TreeNodeId'] = request.treeNodeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTreeNode',
    version = '2022-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateTreeNode(request: UpdateTreeNodeRequest): UpdateTreeNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTreeNodeWithOptions(request, runtime);
}

